package ca.jsbr.as2js_lib.utils.generic 
{
	import js.navigator;
	/**
	 * ...
	 * @author jsbr [me@jsbr.ca]
	 */
	public class BrowserUtils 
	{
		static public const FIREFOX:String = "FF";
		static public const OPERA:String = "Opera";
		static public const INTERNET_EXPLORER:String = "IE";
		static public const CHROME:String = "Chrome";
		static public const SAFARI:String = "Safari";
		static public const KONQUEROR:String = "Konqueror";
		static public const WEBKIT:String = "Webkit";
		
		private var _browserName:String;
		
	
		static public function getBrowserName():String
		{
			if (!_browserName)
			{
				var userAgent:String = navigator.userAgent;
				if (userAgent.indexOf("MSIE") != -1) 
					_browserName=INTERNET_EXPLORER;
				else if (userAgent.indexOf("Firefox") != -1) 
					_browserName=FIREFOX;
				else if (userAgent.indexOf("Chrome") != -1) 
					_browserName=CHROME;
				else if (userAgent.indexOf("Safari") != -1) 
					_browserName=SAFARI;
				else if (userAgent.indexOf("Opera") != -1) 
					_browserName = OPERA;
				else if (userAgent.indexOf("Konqueror") != -1) 
					_browserName = KONQUEROR;
				else if (userAgent.indexOf("WebKit") != -1) 
					_browserName = WEBKIT;
			}
			return _browserName;
		}
		
		static public function isLocal():Boolean
		{
			
		}
		
	}

}